/**
 * 数据服务中数据集 SQL 查询服务类。 在一个或多个指定的图层上查询符合 SQL 条件的空间地物信息。
 * @see http://iclient.supermap.io/libs/iclient8c/apidoc/files/SuperMap/REST/Data/GetFeaturesBySQLService-js.html
 * 
 * @param {string} url 
 * @param {*} {queryParameter, datasetNames, returnContent, fromIndex = 0, toIndex = -1 } 
 */
export function getFeaturesBySQLService(url, { queryParameter, datasetNames, returnContent, fromIndex = 0, toIndex = -1 }) {
  let getFeatureBySQLParams = new SuperMap.REST.GetFeaturesBySQLParameters({
    queryParameter,
    datasetNames,
    returnContent,
    fromIndex,
    toIndex
  });
  return new Promise((resolve, reject) => {
    var myQueryBySQLService = new SuperMap.REST.GetFeaturesBySQLService(url, {
      eventListeners: {
        'processCompleted': resolve,
        'processFailed': reject
      }
    })
    myQueryBySQLService.processAsync(getFeatureBySQLParams)
  })
}